package chen.web.config;

public class SystemConfig extends Config{

	private static final String SessionTimeoutPropertyName = "sessionTimeout";
	
	private int statCacheSize;
	private int sessionTimeout;		//单位分钟
	
	private SystemConfig(Builder builder){
		this.sessionTimeout = builder.sessionTimeout;
	}
	
	SystemConfig(){}
	
	public static class Builder {
		private int sessionTimeout;
		
		public SystemConfig buil(){
			return new SystemConfig(this);
		}
		
		public void sessionTimeout(int sessionTimeout){
			this.sessionTimeout = sessionTimeout;
		}
	}

	@Override
	public void persist() {
		// TODO Auto-generated method stub
		this.setProperty(SessionTimeoutPropertyName, String.valueOf(sessionTimeout));
	}

	@Override
	protected void load() {
		// TODO Auto-generated method stub
		sessionTimeout = Integer.valueOf(getProperty(SessionTimeoutPropertyName));
	}

	public int getSessionTimeOut() {
		return sessionTimeout;
	}
}
